<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/assets/H-ui/static/h-ui/css/H-ui.min.css"/>
    <%--引起冲突的样式--%>
    <%--<link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/table.css"/>--%>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/assets/H-ui/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/assets/H-ui/static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/assets/H-ui/static/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/bootstrap.css"/>
    <!--_footer 作为公共模版分离出去-->
    <script src="${pageContext.request.contextPath}/assets/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/assets/js/bootstrap.min.js"></script>
    <!--/_footer /作为公共模版分离出去-->
    <title>医生小结</title>
</head>
<body>

<%--<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>--%>
<!--/_menu 作为公共模版分离出去-->
    <c:if test="${resultType eq '图片输出'}">
        <div align="center">
            <img src="${pageContext.request.contextPath}/${result}" width="300px" height="300px">
        </div>
    </c:if>
    <c:if test="${resultType !='图片输出'}">
    <div class="Hui-article">

                    <table class="table table-border table-bordered table-hover table-bg table-sort">
                        <div align="center"><h3>项目体检详情</h3></div>
                        <thead>
                        <tr class="text-c">
                            <%--<th hidden></th>--%>
                            <th width="100">报告项目细项Id</th>
                            <th width="100">报告项目Id</th>
                            <th width="40">细项名</th>
                            <th width="90">细项结果</th>
                            <th width="40">细项单位</th>
                            <th width="40">细项提示</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:if test="${not empty page}">
                            <c:forEach items="${page.list}" var="reportDetail">
                                <tr class="text-c">
                                    <td>${reportDetail.reportDetailId}</td>
                                    <td>${reportDetail.reportItemId}</td>
                                    <td>${reportDetail.detail.detailName}</td>
                                    <td>${reportDetail.result}</td>
                                    <td>${reportDetail.detail.unit}</td>
                                    <td>${reportDetail.hint}</td>
                                </tr>
                            </c:forEach>
                        </c:if>
                        </tbody>
                    </table>
                    <div id="page" style="float: right" align="center">
                        总共${page.pages}页，当前第${page.pageNum}页,每页总共${page.pageSize}。
                        <a id="firstPage" class="btn-sm btn-primary" onclick="changeNum(${page.prePage})">上一页</a>
                        <a id="lastPage" class="btn-sm btn-primary" onclick="changeNum(${page.nextPage})">下一页</a>
                    </div>
        </c:if>
        <%--项目小结模块--%>
        <article class="cl pd-20">
            <div class="text-c">
                小结简称：<select onchange="chooseRemark(this)" id="remarkField">
                <option>请选择小结</option>
                <c:if test="${not empty remarks}">
                    <c:forEach items="${remarks}" var="remark">
                        <option value="${remark.remarkField}">${remark.remarkName}</option>
                    </c:forEach>
                </c:if>
            </select>
            </div>
            <div class="text-c">
                <br>
                <span style="font-size: 20px;color: red">小结评语:</span>
                <span style="font-size: 20px;color: red" id="field_input"></span>
                <br>
                <textarea style="width: 500px;height: 100px" id="field"></textarea><br>
                <input type="button" value="提交评语" onclick="addRemark()">
                <input type="button" value="返回" onclick="returnRemark()">
            </div>
</article>

<script type="text/javascript">
    $(function () {
        if (${page.isLastPage}) {
            $("#lastPage").removeAttr("onclick");
        }
    });

    // 选择评语
    function chooseRemark(obj) {
        var remarkField = $("#remarkField").val();
        var field = $("#field");
        field.text("" + remarkField);
    }

    // 选择评语提交
    function addRemark() {
        var flag = true;
        var field = $("#field").val();
        var field_input = $("#field_input");
        field_input.text("");
        var reportItemId=${sessionScope.reportItemId1};
        if (field == null || field == "") {
            field_input.text("小结评语不能为空");
            flag = false;
        }
        if (flag == true){
            location.href = "${pageContext.request.contextPath}/report/remarkSubmit.action?reportItemId="+reportItemId+"&remarkField="+field;
        }
    }
    function returnRemark() {
        location.href = "${pageContext.request.contextPath}/report/remarkSubmit1.action";
    }
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>